<template>
  <!-- 活动列表组件 -->
    <nuxt-link :to="{path:'/activeDetail',query:{'id':item.id}}">
    <!-- <nuxt-link to="/activeDetail"> -->
      <!-- <nuxt-link :to="item.targetUrl">  可能是跳转链接的-->
      <div class="li-wrap" >
        <div class="li-left">
          <img :src="item.imageUrl"/>
          <!-- <img src="https://dss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1208538952,1443328523&fm=26&gp=0.jpg" /> -->
        </div>
        <div class="li-right">
          <div class="li-right-top">
            <div class="title">{{item.title}}</div>
            <div class="details">{{item.content}}</div>
            <div class="state">我要参加 ></div>
          </div>
          <div class="time">
            <img src="../assets/images/h-time-icon.png" alt="" />
            <p>活动时间：{{item.startTime}}</p>
            <p class="time-state">{{item.endTime}}</p>
          </div>
        </div>
      </div>
    </nuxt-link>
</template>
<script>
export default {
  props: {
    item: {
      type: Object,
      default: () => {
        return {}
      }
    },
    index: {
      type: Number,
      default: 0
    }
  },
  components: {
  },
  methods: {
    showLine(index,type='txt') { // 显示动态
      let obj = {}
      if (type === 'bg') {
        if (index%3 === 0) {
          obj.background = '#e5f6ff'
        } else if (index%3 === 1) {
          obj.background = '#ffeeed'
        } else {
          obj.background = '#e1fdea'
        }
      } else {
        if (index%3 === 0) {
          obj.background = '#4187f7'
        } else if (index%3 === 1) {
          obj.background = '#f87169'
        } else {
          obj.background = '#48a267'
        }
      }
      return obj
    }
  }
}
</script>

<style scoped>
  .li-wrap {
    width: 100%;
    height: 293px;
    background: #fff;
    display: flex;
    border-radius: 5px;
    margin-bottom: 20px;
  }
  .li-left {
    width: 490px;
    height: 293px;
    position: relative;
  }
  .li-left img {
    width: 490px;
    height: 293px;
  }
  .li-right {
    width: 327px;
    height: 293px;
  }
  .li-left-btn {
    font-size: 18px;
    color: #fff;
    background: #4187f7;
    border-radius: 100px;
    width: 120px;
    height: 36px;
    text-align: center;
    line-height: 36px;
    position: absolute;
    right: 30px;
    bottom: 36px;
    z-index: 2;
    cursor: pointer;
  }
  .li-right-top {
    margin-top: 40px;
    padding-left: 57px;
    width: 215px;
  }
  .li-right-top .title {
    font-size: 24px;
    color: #333;
  }
  .li-right-top .details {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    margin-top: 24px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .li-right-top .state {
    width: 120px;
    height: 36px;
    background: #4187f7;
    box-sizing: border-box;
    text-align: center;
    color: #fff;
    height: 36px;
    font-size: 16px;
    margin-top: 30px;
    cursor: pointer;
    line-height: 36px;
    border-radius: 100px;
  }
  .li-right-top .state:hover{
    background: #66B1FF;
  }
  .li-right .time {
    width: 273px;
    border-top: 1px solid #e1e1e1;
    margin: 23px auto 0 auto;
    display: flex;
    align-items: center;
    padding-top: 20px;
  }
  .li-right .time img {
    width: 14px;
    height: 14px;
    margin-left: 34px;
  }
  .li-right .time p {
    color: #333;
    font-size: 12px;
    margin-left: 6px;
    flex: 1;
    white-space: nowrap;
  }
  .time-state {
    color: #e65656 !important;
  }
</style>
